package io.gitee.milklynk.vo.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 角色枚举
 */
@Getter
@AllArgsConstructor
public enum Role {
    /** */
    SYSTEM("system","系统"),
    /** */
    USER("user","用户"),
    /** */
    ASSISTANT("assistant","助理");
    /** 角色类型*/
    private final String type;
    /** 角色描述 */
    private final String description;
    /** 根据角色类型查找枚举（忽略大小写）*/
    public static Role fromRoleType(String roleType) {
        for (Role role : values()) {
            if (role.type.equalsIgnoreCase(roleType)) {
                return role;
            }
        }
        throw new IllegalArgumentException("未知角色类型: " + roleType);
    }
    @Override
    public String toString() {
        return type;
    }
}
